#ifndef FORM_H
#define FORM_H

#define MAX_NAME_LEN 32
#define MAX_FIELD_LEN 64

typedef struct FormNode FormNode;
typedef FormNode Form;

struct FormNode {
    char name[MAX_NAME_LEN];
    char value[MAX_FIELD_LEN];
    int name_len;
    int value_len;
    struct FormNode* next;
    struct FormNode* tail;
};

Form* new_form();
FormNode* make_form_node();
void append_form(Form* form, char name[], int name_len, char value[], int value_len);
void delete_form(Form* form);
Form* build_form(const char buf[], int len);
void output_form(Form* form);

#endif /* FORM_H */